using System;

namespace CoreEx.DynamicInvoker
{
    /// <summary>
    /// Represents a class that is capable of invoking a specified member.
    /// </summary>
    public interface IDynamicInvoker
    {
        /// <summary>
        /// Invokes the specified instance member identified by the <paramref name="memberName"/>
        /// </summary>
        /// <param name="target">The target on witch to invoke the member.</param>
        /// <param name="memberName">The name of the member to invoke.</param>
        /// <param name="arguments">An array containing the arguments to pass to the member to invoke.</param>
        /// <returns>An <see cref="Object"/> representing the return value of the invoked member.</returns>
        object Invoke(object target, string memberName, params object[] arguments);

        /// <summary>
        /// Invokes the specified static/shared member identified by the <paramref name="memberName"/>
        /// </summary>
        /// <param name="type">The <see cref="Type"/> that owns the spesified member.</param>
        /// <param name="memberName">The name of the member to invoke.</param>
        /// <param name="arguments">An array containing the arguments to pass to the member to invoke.</param>
        /// <returns>An <see cref="Object"/> representing the return value of the invoked member.</returns>
        object Invoke(Type type, string memberName, params object[] arguments);
    }
}